#  导入Mysql驱动：
import mysql.connector

#  添加链接字符串
conn = mysql.connector.connect(host='192.168.2.163', user='root', password='summit-1', database='study', port='3306')
try:
    cursor = conn.cursor()
    sql = 'SELECT * FROM apps, websites'
    count = cursor.execute(sql)

    for row in cursor.fetchall():
        print('ID:' + str(row[0]) + '  名字：' + row[1] + '  链接：' + row[2])
    conn.commit()
    cursor.close()

finally:
    conn.close()
